import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ECharts from 'vue-echarts'

const app = createApp(App)

// 全局注册 Element Plus 图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 全局注册组件
app.component('v-chart', ECharts)

const pinia = createPinia()
app.use(pinia)
app.use(router)
app.use(ElementPlus)

import { useAuthStore } from '@/stores/auth'
const authStore = useAuthStore()

app.mount('#app')